using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Decision.BusinessLayer.DataLayer;

namespace Decision.BusinessLayer
{
    public class DCS_VOTE_TYPEFactory
    {

        #region data Members

        DCS_VOTE_TYPESql _dataObject = null;

        #endregion

        #region Constructor

        public DCS_VOTE_TYPEFactory()
        {
            _dataObject = new DCS_VOTE_TYPESql();
        }

        #endregion


        #region Public Methods
        
        /// <summary>
        /// get DCS_VOTE_TYPE by primary key.
        /// </summary>
        /// <param name="keys">primary key</param>
        /// <returns>Student</returns>
        public DCS_VOTE_TYPE GetByPrimaryKey(DCS_VOTE_TYPEKeys keys)
        {
            return _dataObject.SelectByPrimaryKey(keys); 
        }

        /// <summary>
        /// get list of all DCS_VOTE_TYPEs
        /// </summary>
        /// <returns>list</returns>
        public List<DCS_VOTE_TYPE> GetAll()
        {
            return _dataObject.SelectAll(); 
        }

        /// <summary>
        /// get list of DCS_VOTE_TYPE by field
        /// </summary>
        /// <param name="fieldName">field name</param>
        /// <param name="value">value</param>
        /// <returns>list</returns>
        public List<DCS_VOTE_TYPE> GetAllBy(DCS_VOTE_TYPE.DCS_VOTE_TYPEFields fieldName, object value)
        {
            return _dataObject.SelectByField(fieldName.ToString(), value);  
        }

        /// <summary>
        /// delete by primary key
        /// </summary>
        /// <param name="keys">primary key</param>
        /// <returns>true for succesfully deleted</returns>
        public bool Delete(DCS_VOTE_TYPEKeys keys)
        {
            return _dataObject.Delete(keys); 
        }

        /// <summary>
        /// delete DCS_VOTE_TYPE by field.
        /// </summary>
        /// <param name="fieldName">field name</param>
        /// <param name="value">value</param>
        /// <returns>true for successfully deleted</returns>
        public bool Delete(DCS_VOTE_TYPE.DCS_VOTE_TYPEFields fieldName, object value)
        {
            return _dataObject.DeleteByField(fieldName.ToString(), value); 
        }

        #endregion

    }
}
